<%@page language="java" pageEncoding="UTF-8"%>
<%@page import="org.firecloud.h5fun.model.CommonConfig"%>
<%@page import="org.firecloud.h5fun.model.javabean.*"%>
<%
	CommonConfig webconfig = (CommonConfig) request.getServletContext().getAttribute("commonConfig");
	UserBean user = (UserBean) request.getAttribute("user");
	int maxPage = (Integer) request.getAttribute("maxPage");
	int currentPage = (Integer) request.getAttribute("currentPage");
	String hiddenMail = (String)request.getAttribute("hiddenMail");
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/common.css" type="text/css" rel="stylesheet" />
<link href="css/icon.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript">
function deleteApplication(id,name){
	if(confirm('确定删除：'+name+'？')){
		$.post('ajax_delete_application',{'id':id},function(data,status){
			if (status == 'success') {
				if (data.type == 0) {
					alert("成功");
					location.reload(true);
				}else{
					alert(data.msg);
					if(data.type == -1){
						location.href = 'Login';
					}
				}
			} else {
				alert("网络错误");
				location.href = 'Index';
			}
		});
	}
}
</script>
<title><%=webconfig.getTitle()%></title>
</head>
<body>
	<div class="doc">
		<jsp:include page="widget-head.jsp" />
		<div class="main-context main-context-label">
			<div class="label"><%=user.getName()%></div>
			<div class="main-context">
				<div>
					邮箱：<%=hiddenMail%></div>
				<div>
					积分：<%=user.getScore()%></div>
				<div>
					注册日期：<%=user.getRegTime()%></div>
				<div>
					最后登陆日期：<%=user.getLastLoginTime()%></div>
			</div>
		</div>
		<div class="main-context main-context-label">
			<div class="label">我的应用</div>
			<div class="main-context">
				<jsp:include page="widget-apps-image-text.jsp">
					<jsp:param name="dataName" value='apps' />
				</jsp:include>
			</div>
			<div class="search-arg">
				<a href="ShowUserInfo?id=<%=user.getId()%>&page=0"><div class="search-arg-cell">
						<i class="icon-first"></i>
					</div></a>
				<%
					for (int i = currentPage - 4; i < currentPage + 4; ++i) {
						if (i >= 0 && i <= maxPage) {
				%>
				<a href="ShowUserInfo?id=<%=user.getId()%>&page=<%=i%>"><div
						class="search-arg-cell <%=i == currentPage ? "search-arg-cell-active" : ""%>"><%=i + 1%></div></a>
				<%
					}
					}
				%>
				<a href="ShowUserInfo?id=<%=user.getId()%>&page=<%=maxPage%>"><div class="search-arg-cell">
						<i class="icon-last"></i>
					</div></a>
			</div>
		</div>
		<jsp:include page="widget-foot.jsp" />
	</div>
</body>
</html>
